#ifndef POSITION_OUT_H
#define POSITION_OUT_H
#include "motion9_dll.h"

#define Q_BUFFLEN 10

//---------------------------------------------
typedef struct{
	double posit[MAX_JOINT];
	float vel[MAX_JOINT];
	float acc[MAX_JOINT];
}STRUCT_PO_SEGMENT;

typedef struct {
	STRUCT_PO_SEGMENT *queue;	/* ptr to the tcs */
	int size;			/* size of queue */
	int _len;			/* number of tcs now in queue */
	int start, end;		/* indices to next to get, next to put */
	int allFull;		/* flag meaning it's actually full */
}STRUCT_PO_QUEUE;

typedef struct{
	STRUCT_PO_QUEUE queue;
	STRUCT_PO_SEGMENT po_space[Q_BUFFLEN];
}STRUCT_PO;

int poqCreate(STRUCT_PO_QUEUE * const tcq, int _size, STRUCT_PO_SEGMENT * const tcSpace);
int poqDelete(STRUCT_PO_QUEUE * const tcq);
int poqInit(STRUCT_PO_QUEUE * const tcq);
int poqPut(STRUCT_PO_QUEUE * const tcq, STRUCT_PO_SEGMENT const * const tc);
int poqPopBack(STRUCT_PO_QUEUE * const tcq);
int poqRemove(STRUCT_PO_QUEUE * const tcq, int n);
int poqLen(STRUCT_PO_QUEUE const * const tcq);
STRUCT_PO_SEGMENT * poqItem(STRUCT_PO_QUEUE const * const tcq, int n);
STRUCT_PO_SEGMENT * poqLast(STRUCT_PO_QUEUE const * const tcq);
int poqFull(STRUCT_PO_QUEUE const * const tcq);



#endif